#!/bin/bash
# shellcheck disable=SC2034
################################################################################
#                                                                              #
#                               English	                                       #
#                                                                              #
#                 Last entry update   :  Nov 01, 2019 (v1.2.0)                 #
#                                                                              #
#              Last translations update  :  Nov 01, 2019 (v1.2.0)              #
#                                                                              #
################################################################################

# Language Flag
lang_ui="en"

## Gobal Element
BUTTON_YES="Yes"
BUTTON_NO="No"
BUTTON_OK="Ok"
BUTTON_CANCLE="Cancel"
BUTTON_CONFIRM="Start Installation"
BUTTON_EDIT="Edit"
BUTTON_ABORT="Abort"
BUTTON_ACCEPT="Accept"
BUTTON_DECLINE="Decline"

## Env Check
ERROR="Error"
ERROR_TITLE_PERM="Permission Error"
ERROR_TEXT_PERM="            This script must be run with root privileges!"
ERROR_TITLE_OS="OS Error"
ERROR_TEXT_DESTRO_1="It looks like you are running "
ERROR_TEXT_DESTRO_2=", which is not supported by QuickBox Lite"
ERROR_TEXT_CODENAME_1="Oh drats! You do not appear to be running a supported "
ERROR_TEXT_CODENAME_2=" release."
ERROR_TEXT_OSARCH="QuickBox Lite only support amd64 OS!"
ERROR_TITLE_KERNEL="Kernel Error"
ERROR_TEXT_KERNEL_1="Your server is currently running with kernel version: "
ERROR_TEXT_KERNEL_2="Kernels with grsec are not supported"
ERROR_TITLE_OVZ="Virtual Machine Error"
ERROR_TEXT_OVZ="This Script currently not support OpenVZ virtualization."
INFO="Info"
INFO_TITLE_REPLACE_KERNEL="Replace Kernel"
INFO_TEXT_REPLACE_KERNEL="Would you like QuickBox to install the distribution kernel?"
INFO_TEXT_REPLACE_KERNEL_CONFIRM="Your distribution's default kernel will be installed.\nA reboot will be required."
INFO_TITLE_EXIT="Exiting"
INFO_TEXT_ABORT="Installer will not continue."

## Welcome
INFO_TITLE_WELCOME="Welcome"
INFO_TEXT_WELCOME="            Welcome to QuickBox Lite installation guide"
INFO_TITLE_MANUAL="Manual"
INFO_TEXT_MANUAL="Installation Manual:\n\
type \"Tab\" or Arrow key to choose the button\n\
type \"Enter\" key to confirm\n\
type \"Space\" key to mark object\n\
\"(*)\" or \"[*]\" means marked"
INFO_TITLE_DISCLAIMER="Disclaimer"
INFO_TEXT_DISCLAIMER="This script is intended for general use and no warranty is implied\n\
for suitability to any given task. We will hold no responsibility \n\
for your setup or any damage done while using/installing/modifying \n\
this script or any of its plugins."

## Install infos
INFO_TITLE_LOG="Log"
INFO_TEXT_LOG="Do you wish to write to a log file?"
INFO_TITLE_DOMAIN="Domain"
INFO_TEXT_DOMAIN="Setup a domain with let'encrypt protection?"
INFO_TITLE_SETDOMAIN="Setup Domain"
INFO_TEXT_SETDOMAIN="Please enter a domain for this server\nMake sure A record already exist before continue!"
ERROR_TITLE_DOMAINCHK="A record not found"
ERROR_TEXT_DOMAINCHK_1="The A record for domain "
ERROR_TEXT_DOMAINCHK_2=" not detected.\nPlease recheck and try again."
INFO_TITLE_DOMAINCHK="Check A record"
INFO_TEXT_DOMAINCHK_1="The A record for domain "
INFO_TEXT_DOMAINCHK_2=" checked successful, continue."
INFO_TITLE_HOSTNAME="Hostname"
INFO_TEXT_HOSTNAME="Please enter a hostname for this server\nENTER to make no changes"
INFO_TITLE_SSH="SSH Port"
INFO_TEXT_SSH="  Change a SSH port for security?"
INPUT_TEXT_SSH="  Custom SSH port(1-65535):"
CHOICE_TEXT_SSH_1="    default port"
CHOICE_TEXT_SSH_2="    security port"
CHOICE_TEXT_SSH_3="    custom port"
ERROR_TITLE_SSH="Invalid SSH Port"
ERROR_TEXT_SSH="SSH Port should in range of 1-65535"
INFO_TITLE_QUOTA="User quota"
INFO_TEXT_QUOTA="Do you wish to use user quotas?"
INFO_TITLE_NAME="Create a Admin account"
INFO_TEXT_NAME="What is your username?"
ERROR_TITLE_NAME="Bad username"
ERROR_TEXT_NAME_1="Do not use reversed user name !"
ERROR_TEXT_NAME_2="User name cannot less than 3 or more than 32 characters !"
ERROR_TEXT_NAME_3="Your username must start from a lower case letter and the username \nmust contain only lowercase letters, numbers, hyphens, and underscores."
INFO_TITLE_PASSWD="Enter password"
INFO_TEXT_PASSWD="Please enter your password"
ERROR_TITLE_PASSWD="Input password Error"
ERROR_TEXT_PASSWD_1="Your password cannot less than 8 characters !"
ERROR_TEXT_PASSWD_2="Your password must consist:\n1.digital numbers\n2.at least one lower case letter\n3.one upper case letter"
INFO_TITLE_MOUNT="Mount Point"
INFO_TEXT_MOUNT="   Choose a primary Mount Point\n  (Mountpoint  Device      Size)"
ERROR_TITLE_MOUNT="Mount Point Error"
ERROR_TEXT_MOUNT="It looks like you didn't choose any mount point yet,\ntype Space to choose one!"
INFO_TITLE_THEME="Theme"
INFO_TEXT_THEME="    Pick your QuickBox Dashboard Theme"
CHOICE_TEXT_THEME_1="  default light theme"
CHOICE_TEXT_THEME_2="  dark theme"
INFO_TITLE_TZ="Timezone"
INFO_TEXT_TZ="Change Timezone?"
INFO_TITLE_FTP="FTP"
INFO_TEXT_FTP="Do you want to setup FTP service?"
INFO_TITLE_FTP_IP="Bind IP"
INFO_TEXT_FTP_IP_1="Your public IP is"
INFO_TEXT_FTP_IP_2="Do you want to bind another IP for FTP? ENTER to make no changes"
INFO_TITLE_SOURCE="source.list"
INFO_TEXT_SOURCE="Do you want to replace default source.list?"
INFO_TEXT_SOURCE_EXTRA="Choose a source list below"
CHOICE_TEXT_SOURCE_EXTRA_US="USA"
CHOICE_TEXT_SOURCE_EXTRA_AU="Australia"
CHOICE_TEXT_SOURCE_EXTRA_CN="China"
CHOICE_TEXT_SOURCE_EXTRA_FR="France"
CHOICE_TEXT_SOURCE_EXTRA_DE="Germeny"
CHOICE_TEXT_SOURCE_EXTRA_JP="Japan"
CHOICE_TEXT_SOURCE_EXTRA_RU="Russia"
CHOICE_TEXT_SOURCE_EXTRA_UK="United Kingdom"
CHOICE_TEXT_SOURCE_EXTRA_TUNA="tsinghua"
INFO_TITLE_CDN="Software CDN"
INFO_TEXT_CDN="Do you want to change default software CDN"
INFO_TEXT_CDN_EXTRA="Choose a CDN below"
CHOICE_TEXT_CDN_EXTRA_CF="Cloudflare"
CHOICE_TEXT_CDN_EXTRA_SF="Sourceforge"
CHOICE_TEXT_CDN_EXTRA_OSDN="OSDN (Sourceforge JP)"
CHOICE_TEXT_CDN_EXTRA_GITHUB="GitHub (default)"
INFO_TITLE_APPS="Install Software"
INFO_TEXT_APPS="Choose your features."
CHOICE_TEXT_APPS_1="rTorrent v0.9.8"
CHOICE_TEXT_APPS_2="Transmission v2.94"
CHOICE_TEXT_APPS_3="qBittorrent v4.2.5"
CHOICE_TEXT_APPS_4="Deluge v1.3.15"
CHOICE_TEXT_APPS_5="CLI Torrent creater"
CHOICE_TEXT_APPS_6="CLI multimedia tools"
CHOICE_TEXT_APPS_7="Web base filebrowser"
CHOICE_TEXT_APPS_8="Linux RAR"
INFO_TITLE_RTGUI="rTorrent GUI"
INFO_TEXT_RTGUI="Select a GUI for rTorrent"
CHOICE_TEXT_RTGUI_1="  Powerful WebUI for rTorrent"
CHOICE_TEXT_RTGUI_2="  Lightweight WebUI for rTorrent"
ERROR_TITLE_RTGUI="rTorrent GUI Error"
ERROR_TEXT_RTGUI="It looks like you didn't choose any rTorrent GUI yet,\ntype Space to choose one!"
INFO_TITLE_DENYTRACKER="Public Trackers"
INFO_TEXT_DENYTRACKER="Block Public Trackers?"
INFO_TITLE_BBR="BBR"
INFO_TEXT_BBR="Would you like to install BBR? (Used for Congestion Control)"
CHOICE_TEXT_BBR_1="Do not enable BBR"
CHOICE_TEXT_BBR_2="Enable BBR"
INFO_TITLE_XENIAL_BBR="Kernel replace request"
INFO_TEXT_XENIAL_BBR="BBR needs a higher kernel version.\nThe kernel replacement will be finished automatically,\n but there is a risk of failing to start,\n Continue?"
INFO_TITLE_SWAP="Swap File"
INFO_TEXT_SWAP_1="It seems your Memory too small. A swap file is required."
INFO_TEXT_SWAP_2="Do you want to use another location? \nENTER to use /root/.swapfile by default"
INFO_TITLE_SWAPON="Create swap file"
INFO_TEXT_SWAPON_0="Generating a swap file..."
INFO_TEXT_SWAPON_1="Cleaning up swap file..."
INFO_TEXT_SWAPON_2="Mounting swap file..."
INFO_TEXT_SWAPON_3="Making auto mount..."
INFO_TITLE_AUTOREBOOT="Auto Reboot"
INFO_TEXT_AUTOREBOOT="Automatically reboot after installation completed?"

## Conclusion
INFO_TITLE_SUMMARY="Install Info"
INFO_TEXT_SUMMARY_1="Please Confirm following info:"
INFO_TEXT_SUMMARY_2="Your Installation log file is:"
INFO_TEXT_SUMMARY_3="Your new hostname is:"
INFO_TEXT_SUMMARY_4="You can access your SSH via:"
INFO_TEXT_SUMMARY_5="Your admin account is:"
INFO_TEXT_SUMMARY_6="The password of account is:"
INFO_TEXT_SUMMARY_7="will be used as primary root"
INFO_TEXT_SUMMARY_8="User quota will"
INFO_TEXT_SUMMARY_9=" Not "
INFO_TEXT_SUMMARY_10="be installed"
INFO_TEXT_SUMMARY_11="You can access your FTP via:"
INFO_TEXT_SUMMARY_12="The"
INFO_TEXT_SUMMARY_13="theme will be installed"
INFO_TEXT_SUMMARY_14="source.list will be replaced"
INFO_TEXT_SUMMARY_15="Following apps will be installed:"
INFO_TEXT_SUMMARY_16=" will be installed"
INFO_TEXT_SUMMARY_17="Auto Reboot scheduled"
INFO_TEXT_SUMMARY_18="BBR will be enabled"
INFO_TEXT_SUMMARY_19="will be used"
INFO_TEXT_SUMMARY_20="Your new domain is:"
INFO_TEXT_ABORT="Do you want to edit your choice?"
INFO_TITLE_EDIT="Edit Menu"
INFO_TEXT_EDIT="Choose an option"
CHOICE_TEXT_EDIT_1="Change host name"
CHOICE_TEXT_EDIT_2="Choose a SSH service port"
CHOICE_TEXT_EDIT_3="Change Admin account name"
CHOICE_TEXT_EDIT_4="Change Admin account password"
CHOICE_TEXT_EDIT_5="Change primary mount point"
CHOICE_TEXT_EDIT_6="Enable or disable quota"
CHOICE_TEXT_EDIT_7="Change FTP settings"
CHOICE_TEXT_EDIT_8="Choose a dashboard theme"
CHOICE_TEXT_EDIT_9="Change source.list"
CHOICE_TEXT_EDIT_10="Choose software features"
CHOICE_TEXT_EDIT_11="Enable or disable auto reboot"
CHOICE_TEXT_EDIT_12="Enable or disable BBR"
CHOICE_TEXT_EDIT_13="Select another CDN"
CHOICE_TEXT_EDIT_14="Setup another domain"

# Progress
INFO_TITLE_PROGRESS="Install QuickBox Lite"
INFO_TEXT_DONE="Done."
INFO_TEXT_SKIP="Skip."
INFO_TEXT_PROGRESS_0="Please wait while installing"
INFO_TEXT_PROGRESS_1="Setting up new hostname... "
INFO_TEXT_PROGRESS_2="Setting up new SSH port... "
INFO_TEXT_PROGRESS_3="Setting up Administrator account... "
INFO_TEXT_PROGRESS_3_1="Setting up /etc/skel... "
INFO_TEXT_PROGRESS_3_2="Setting up lshell... "
INFO_TEXT_PROGRESS_4="Replace source.list... "
INFO_TEXT_PROGRESS_5="Installation dependency packages... "
INFO_TEXT_PROGRESS_6="Setting up quota... "
INFO_TEXT_PROGRESS_7="Setting up dashboard... "
INFO_TEXT_PROGRESS_7_1="Setting up nginx... "
INFO_TEXT_PROGRESS_7_2="Setting up quickbox background service... "
INFO_TEXT_PROGRESS_7_3="Setting up webconsole... "
INFO_TEXT_PROGRESS_8="Installation Applications... "
INFO_TEXT_PROGRESS_9="Block Public trackers... "
INFO_TEXT_PROGRESS_10="Setting up FTP service... "
INFO_TEXT_PROGRESS_11="Installation BBR... "
INFO_TEXT_PROGRESS_12="Setting up domain... "
INFO_TEXT_PROGRESS_13="Finishing installation... "
INFO_TEXT_PROGRESS_14="Installation Finished"
INFO_TEXT_PROGRESS_Extra_1="Updating System packages... "
INFO_TEXT_PROGRESS_Extra_2="Installing "
INFO_TITLE_FIN="Finish"
INFO_TEXT_FIN_1="Installation finished in about "
INFO_TEXT_FIN_2="Reboot now?"
INFO_TEXT_FIN_MIN=" min"
ERROR_TITLE_INSTALL="Unexpected Error"
ERROR_TEXT_INSTALL_1="Can not install "
ERROR_TITLE_NODEJS="Node.js ERROR"
ERROR_TEXT_NODEJS="Fail to update node.js source list! exit"

# 3rd-part apps
INFO_TEXT_INSTALLAPP_1="Installing rTorrent... "
INFO_TEXT_INSTALLAPP_2="Installing Transmission... "
INFO_TEXT_INSTALLAPP_3="Installing qBittorrent... "
INFO_TEXT_INSTALLAPP_4="Installing Deluge... "
INFO_TEXT_INSTALLAPP_5="Installing mktorrent... "
INFO_TEXT_INSTALLAPP_6="Installing FFmpeg... "
INFO_TEXT_INSTALLAPP_7="Installing File Browser... "
INFO_TEXT_INSTALLAPP_8="Installing linux RAR... "